import { Component } from "@angular/core";
import { NgForm } from "@angular/forms";

@Component({
  selector: 'form-validate',
  templateUrl: './formvalidate.html'
})
export class FormValidateComponent {
  user: User = { name: '' };

  constructor() { }

  formControls(form: NgForm) {
    return Object.keys(form.controls);
  }
}

export interface User {
  name: string;

  gender?: '0' | '1';
}